package apIExercise.file;

import java.io.File;
import java.io.FileFilter;

public class Test06 {
    public static void main(String[] args) {
        File file=new File(".");
            File[] files=file.listFiles(new FileFilter() {
                @Override
                public boolean accept(File file1) {
                    String name=file1.getName();
                    return name.contains("s");
                }
            });
            for(File file1:files){
                System.out.println(file1);
        }

        //Lambda
        File dir=new File("./src");

            File[] file1=dir.listFiles(dir1->dir1.getName().contains("day"));
            for(File dir1:file1){
                System.out.println(dir1);

        }
        //
        File dir1=new File(".");
        String[] name =dir1.list((dir2, name1) -> name1.contains("oo"));
        for(String sub:name){
            System.out.println(sub);
        }
    }
}
